<?php

/**
 * gallery actions.
 *
 * @package    videosurv
 * @subpackage gallery
 * @author     Mina Gerges
 * @version    SVN: $Id: actions.class.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class public_processingActions extends sfActions
{

    /**
     * action execute before any action
     */
    public function preExecute()
    {
        $this->user = $this->getUser()->getAttribute('user');
        $this->companyData = $this->getUser()->getAttribute('company');
    }

    public function executeRenderPublicItem(sfWebRequest $request)
    {
        $this->type = $request->getParameter('type');
        switch ($this->type)
        {
            case ('pui'): // Public Url Image
                $this->image_name = $request->getParameter('imageName');
                $this->image_format = $request->getParameter('format');
                $this->camera_id = $request->getParameter('c');
                $this->company_id = $request->getParameter('com');
                // send camera_id , company_id encoded to view 
                // becouse if we decode camera_id , company_id in action and send thim decoded
                // we will need to encode it again in view to send it again to render action
                break;
            case ('puv'): //Public Url Video
                $this->vid = $request->getParameter('vid');
                $this->camera_id = $request->getParameter('c');
                $this->company_id = $request->getParameter('com');
                break;
            default :
                $this->forward404();
                break;
        }
    }

}
